package com.example.bawolf.jms.topic;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

/**
 * @author zhougf
 * @version 1.0
 * @date 2020/03/11
 */
public class MessageListenerImpl implements MessageListener {
    @Override
    public void onMessage(Message message) {
                        {        if(message != null && message instanceof TextMessage){
                    try {
                        TextMessage textMessage = (TextMessage) message;
                        System.out.println("接收到消息" + textMessage.getText());
                    } catch (JMSException e) {
                        e.printStackTrace();
                    }
                }}
    }
}
